<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>adminer后台管理系统</title>
<link href="<{$APP_PUBLIC_PATH}>images/css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<{$APP_PUBLIC_PATH}>javascript/jquery.min.js"></script>
<script type="text/javascript" src="<{$APP_PUBLIC_PATH}>javascript/jquery.form.js"></script>
<script src="lib/ckeditor/ckeditor.js" type="text/javascript"></script>
<script src="lib/ckfinder/ckfinder.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){ //这个就是传说的ready
		$("#main_big").slideToggle("slow");
});
</script>
</head>

<body style="background:#FFF">

	<div id="showproperty">
    	<div class="closed">关闭</div>
    	<form id="new_proerty" name="new_proerty" method="post" action="?m=Product&a=ajax_newproperty_get">
    		新增属性：<input type="text" class="inputc" name="property" id="property" style="width:80px;" /> 英文属性：<input type="text" class="inputc" name="e_property" style="width:80px;" id="e_property" /> 
            类型：<select name="show_sort" id="show_sort" class="inputc">
              		<option value="text">单行文本</option>
              		<option value="textarea">多行文本</option>
  		  		 </select>
         <input name="getnewproperty" type="submit" value="提交" />
    	</form>
        <div id="property_tishi">
        	<h4>提示：</h4>
        </div>
        <div id="allpropertyshow">
        <form id="get_property" name="get_property" method="post" action="?m=Product&a=ajxa_property_addshow">
        	<ul class="allpropertyul">
                
                <volist name="property_list" id="plo">
    				<li><label for="property<{$plo.property_id}>"><input type="checkbox" name="property_id[]" id="property<{$plo.property_id}>" value="<{$plo.property_id}>" /> <{$plo.property}>[<{$plo.e_property}>]
    				  <input type="hidden" name="show_sort[]" id="show_sort" value="<{$plo.show_sort}>" /><input type="hidden" name="property[]" id="property" value="<{$plo.property}>" />
    				</label>
    				</li>
                </volist>
            </ul>
          <div id="insert"><input name="insertget" id="insertget" type="submit" value="确定" /> <input name="delinsertget" id="delinsertget" type="button" value="清空属性" /></div><input name="property_delete" id="property_delete" type="button" value="删除选中属性" />
       </form>
       
       <form id="del_property" name="del_property" method="post" action="?m=Product&a=ajax_property_del">
        	<ul class="allpropertyul">
                
                <volist name="property_list" id="plo">
    				<li><label for="del_property<{$plo.property_id}>"><input type="checkbox" name="property_id[]" id="del_property<{$plo.property_id}>" value="<{$plo.property_id}>" /> <{$plo.property}>[<{$plo.e_property}>]
    				  <input type="hidden" name="show_sort[]" id="show_sort" value="<{$plo.show_sort}>" /><input type="hidden" name="property[]" id="property" value="<{$plo.property}>" />
    				</label>
    				</li>
                </volist>
            </ul>
          <div id="insert"><input name="insertget" id="insertget" type="submit" value="确定" /> <input name="delinsertget" id="delinsertget" type="reset" value="重设" /></div>
       </form>
      </div>
	</div>
    
<div id="main_big" style="display:none">新增产品信息</div>
    <div id="main_contents">
    <div id="main_description">描述：新增产品信息</div>
<script type="text/javascript">
$(document).ready(function(){ 
		$("#form1").slideDown("slow");
        $(".main_table tr:even").addClass("alt");
		$('#form1').ajaxForm(function(date) {
			alert('新增成功');
			window.location.href='?m=Product&a=edit&pid='+date;
    	});
		$("#newproperty").click(function(){
			$("#showproperty").fadeIn(200);
		});
		$("#showproperty .closed").click(function(){
			$("#showproperty").fadeOut(200);
		});
		$('#new_proerty').ajaxForm(function(json) {
			var json = eval("("+json+")");
			var property = json.property;
			var property_id = json.property_id;
			var e_property = json.e_property;
			var show_sort = json.show_sort;
			$(".allpropertyul").append('<li><label for="property'+json.property_id+'"><input type="checkbox" name="property_id" id="property'+json.property_id+'" value="'+json.property_id+'" /> '+json.property+'['+json.e_property+']<input type="hidden" name="sort" id="sort" value="'+json.show_sort+'" /><input type="hidden" name="property" id="property" value="'+json.property+'" /></label></li>');
		});
		$('#get_property').ajaxForm(function(json) {
			var json = eval("("+json+")");
			$("tbody#property").append(json);
		});
		$("#delinsertget").click(function(){
			$("tbody#property tr").remove();
		});
		$("#property_delete").click(function(){
			$("#del_property").toggle();	
		});
});

</script>
<form id="form1" name="form1" method="post" style="display:none;" action="?m=Product&a=product_news_get" enctype="multipart/form-data">
    <div id="table_c">
    	<table border="0" cellspacing="1" class="main_table">
        <thead>
       		 <tr>
            	<th colspan="2">新增产品信息</th>
            </tr>
        </thead>
        <tbody>
        	 <tr>
              <td align="right" valign="middle">产品名称</td>
              <td align="left" valign="middle"><input class="input_c" type="text" name="title" id="title" /></td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">产品英文名称</td>
              <td align="left" valign="middle"><input class="input_c" type="text" name="e_title" id="e_title" /></td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">产品分类</td>
              <td align="left" valign="middle">
              	<select name="sortid">
                    <volist name="sort1" id="so">
                    <option value="<{$so.sort_id}>"><{$so.title}></option>
                        <volist name="sort2" id="co">
                        <if condition="$so['sort_id'] eq $co['sid']">
                        <option value="<{$co.sort_id}>" style=" background:#CCC;"> &nbsp; &nbsp; |--<{$co.title}></option>
                        </if>
                        </volist>
                    </volist>
              	</select>
              </td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">品牌</td>
              <td align="left" valign="middle"><input class="input_c" type="text" name="brand" id="brand" /></td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">编号</td>
              <td align="left" valign="middle"><input class="input_c" type="text" name="No" id="No" /></td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">描述</td>
              <td align="left" valign="middle"><textarea class="input_c" name="overview" id="overview" cols="45" rows="5"></textarea></td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">英文描述</td>
              <td align="left" valign="middle"><textarea class="input_c" name="e_overview" id="e_overview" cols="45" rows="5"></textarea></td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">是否会员产品</td>
              <td align="left" valign="middle"><input type="radio" name="memberproduct" id="memberproduct" value="1" /> 是 <input type="radio" name="memberproduct" id="memberproduct" value="0" checked="checked" /> 否</td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">是否最新产品</td>
              <td align="left" valign="middle"><input type="radio" name="newsproduct" id="newsproduct" value="1" /> 是 <input type="radio" name="newsproduct" id="newsproduct" value="0" checked="checked" /> 否</td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">是否促销产品</td>
              <td align="left" valign="middle"><input type="radio" name="specialproduct" id="specialproduct" value="1" /> 是 <input type="radio" name="specialproduct" id="specialproduct" value="0" checked="checked" /> 否</td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">是否显示</td>
              <td align="left" valign="middle"><input type="radio" name="show_m" id="show_m" value="1" checked="checked" /> 是 <input type="radio" name="show_m" id="show_m" value="0" /> 否</td>
             </tr>
          </tbody>
             <thead>
       		 <tr>
            	<th colspan="2">产品属性</th>
            </tr>
            </thead>
         <tbody>
        	 <tr>
              <td align="right" valign="middle">尺寸</td>
              <td align="left" valign="middle"><input class="input_c" type="text" name="sizes" id="sizes" /></td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">英文尺寸</td>
              <td align="left" valign="middle"><input class="input_c" type="text" name="e_sizes" id="e_sizes" /></td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">价格</td>
              <td align="left" valign="middle"><input class="input_c" type="text" name="price" id="price" /></td>
             </tr>
             </tbody>
             <tbody id="property">
             
             </tbody>
         <tbody>
             <tr>
             	<td align="right" valign="middle"></td>
              	<td align="left" valign="middle"><input type="button" name="newproperty" id="newproperty" value="新增属性" /> <!--<input type="button" name="allproperty" id="allproperty" value="新增全部属性" />--></td>
             </tr>
             </tbody>
             <thead>
       		 <tr>
            	<th colspan="2">详细描述</th>
            </tr>
            </thead>
        	 <tr>
              <td align="right" valign="middle">产品详细内容</td>
              <td align="left" valign="middle"><textarea class="input_c" name="contents" id="contents" cols="45" rows="5"></textarea>
<script type="text/javascript">
var editor = CKEDITOR.replace( 'contents',
{
width:'80%',
height:'500'
});
CKFinder.SetupCKEditor(editor, 'lib/ckfinder/');
</script>
              </td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">产品英文内容</td>
              <td align="left" valign="middle"><textarea class="input_c" name="e_contents" id="e_contents" cols="45" rows="5"></textarea>
              <script type="text/javascript">
var editor = CKEDITOR.replace( 'e_contents',
{
width:'80%',
height:'500'
});
CKFinder.SetupCKEditor(editor, 'lib/ckfinder/');
</script>
              </td>
             </tr>
             </tbody>
        </table>

</div>
            	  <input type="submit" name="button" id="button" class="main_get" value="提  交" />
      </form>
	</div>


</body>
</html>
